# 方式一：遍历可迭代对象的方式
# l = [1, 2, 3, 4, 5]
# index = 0
# while index < len(l):
#     print(l[index])
#     index += 1
#


# 方式二：
# l = [1, 2, 3, 4, 5]
# for x in l:
#     print(x)

# 方式三：
# l = [1, 2, 3, 4, 5]
# for x in l:
#     print(f"({l.index(x)}, {x})")


# 方式四
# l = [1, 2, 3, 4, 5]
# for x in enumerate(l):
#     print(x)

# zip遍历:可以实现多个列表的同时遍历
l1 = [1, 2, 3, 4, 5]
l2 = [6, 7, 8, 9, 10]
l3 = [0, 0, 0, 0, 0]
for x, y, z in zip(l1, l2, l3):
    print(x)
    # print("---------------")
    print(y)
    print(z)
